/**
 * 文件名：ServiceType.java
 *
 * 创建人：Fyh - 1009173473@qq.com
 *
 * 创建时间：2020年6月5日 上午10:16:50
 *
 * 版权所有：南京植百汇智能科技服务有限公司
 */
package com.z100h.supplychain.order.enums;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

/**
 * [描述信息：说明类的基本功能]
 *
 * @author Fyh - 1009173473@qq.com
 * @version 1.0 Created on 2020年6月5日 上午10:16:50
 */
public enum RentType {

	/**
	 * 
	 */
	RENT("租赁", "0", "0"),
	/**
	 * 
	 */
	TAKEOVER("接管", "1", "0"),
	/**
	 * 
	 */
	SALE("售卖", "2", "1"),
	/**
	 * 
	 */
	RECEIVING("领用", "3", "1"),

	REPAIR("复壮", "4", "1"),

	/**
	 * 
	 */
	ERROR("未设置", "999", "999");

	private String name;

	private String type;

	/**
	 * 前端样式显示类型（订单详情相关）
	 * 0代表租赁、接管类
	 * 1代表售卖、领用类
	 */
	private String styleType;

	private RentType(String name, String type, String styleType) {
		this.name = name;
		this.type = type;
		this.styleType = styleType;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getStyleType() {
		return styleType;
	}

	public void setStyleType(String styleType) {
		this.styleType = styleType;
	}

	public static RentType get(String rentType) {
		if (StringUtils.isNotBlank(rentType)) {
			switch (rentType) {
				case "0":
					return RENT;
				case "1":
					return TAKEOVER;
				case "2":
					return SALE;
				case "3":
					return RECEIVING;
				case "4":
					return REPAIR;
				default:
					return ERROR;
			}
		}
		return null;

	}

	/**
	 * 
	 * 销售统计需要的订单类型
	 * 
	 * @return
	 * @author: Elvin Zhao - 279152260@qq.com 
	 * @date: Created on 2021年3月23日 下午3:03:16
	 */
	public static List<String> getSalerStatRentType() {
		List<String> rentTypes = new ArrayList<String>(3);
		rentTypes.add(RENT.getType());
		rentTypes.add(SALE.getType());
		rentTypes.add(RECEIVING.getType());
		return rentTypes;
	}

	public static List<String> getReceivingRentType() {
		List<String> rentTypes = new ArrayList<String>(1);
		rentTypes.add(RECEIVING.getType());
		return rentTypes;
	}

	public static List<String> getNotReceivingRentType() {
		List<String> rentTypes = new ArrayList<String>(3);
		rentTypes.add(RENT.getType());
		rentTypes.add(SALE.getType());
		rentTypes.add(TAKEOVER.getType());
		return rentTypes;
	}

}
